package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javabean.Report;

public class Insertrep extends Insert{
	public void insertDB(Report rep) {
        Connection conn = null;
        PreparedStatement pstmt = null;
        
        try {
        	conn = getConnection();

            pstmt = conn.prepareStatement("insert into REPORT values (?,?,?,?,?,?,?,?,?,?)");
            pstmt.setString(1, null);
            pstmt.setString(2, rep.getRepNAME());
            pstmt.setString(3, rep.getRepTEXT());
            pstmt.setString(4, rep.getRepDATE());
            pstmt.setInt(5, rep.getProNO());
            pstmt.setString(6, rep.getProASTART());
            pstmt.setInt(7, rep.getProDATE());
            pstmt.setInt(8, rep.getProECOST());
            pstmt.setInt(9, rep.getProACOST());
            pstmt.setString(10, rep.getEmpID());
            
            pstmt.executeUpdate();
        } catch(SQLException ex) {
            
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}